﻿using Gnivc.CarDealership.Api.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;

namespace Gnivc.CarDealership.Api.Infrastructure.Persistence;

public interface IApplicationDbContext
{
    DbSet<User> Users { get; }
    DbSet<Brand> Brands { get; }
    DbSet<Model> Models { get; }
    DbSet<Price> Prices { get; }
    DbSet<Reservation> Reservations { get;}
    DbSet<Vehicle> Vehicles { get; }

    Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);

    Task<IDbContextTransaction> BeginTransactionAsync();
    Task CommitTransactionAsync();
    Task RollbackTransactionAsync();
}
